home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / pcboard / msgtag11.zip / WAIT.PPS < prev   
Text File  |  1996-01-30  |  7KB  |  260 lines

  1. ;──────────────────────────────────────────────────────────────────────────────
  2. ;  WAIT.PPE - By Dan Shore - SysOp
  3. ;                The Shoreline BBS
  4. ;
  5. ;  Purpose:  Replacement of the Press (Enter) to Continue prompt
  6. ;            for use with the msg tagging PPE's (QSCAN, READ, KILL,
  7. ;            RECOVER, MORE, MEC)
  8. ;
  9. ;  To install:
  10. ;
  11. ;    1) Edit your PCBText file and change the following entry:
  12. ;
  13. ;       MKPCBTXT PCBTEXT /I:418 "!C:\PCB\PPE\WAIT\WAIT.PPE"
  14. ;
  15. ;       Note: You may have to change the pathname of the WAIT.PPE
  16. ;
  17. ;──────────────────────────────────────────────────────────────────────────────
  18. ;──────────────────────────────────────────────────────────────────────────────
  19. ; Note: If you do not wish to have a mutiple colorized prompt, you can do
  20. ;       two things.  You can go to :SET_NEW_COLOR and change the colors
  21. ;       to your liking.
  22. ;
  23. ;       If you do change the color in :SET_NEW_COLOR you must make sure
  24. ;       the color name you are using in defined in :SET_COLOR_MODE
  25. ;
  26. ;──────────────────────────────────────────────────────────────────────────────
  27. STRING hold1                ' Generic string variable
  28. STRING esc                  ' ESC character
  29. STRING red(2)               ' Color
  30. STRING dcyan(2)             '  ""
  31. STRING cyan(2)              '  ""
  32. STRING white(2)             '  ""
  33. STRING yellow(2)            '  ""
  34. STRING green(2)             '  ""
  35. STRING purple(2)            '  ""
  36. STRING normal(2)            '  ""
  37. STRING blue(2)              '  ""
  38. STRING hold                 ' Generic string variable
  39. STRING prompt               ' Display prompt variable
  40. STRING sema_path            ' Path and name of semaphore file
  41. STRING page_length_file     ' File containing users original page length
  42. STRING tag_msg_file         ' File containing tagged msgs
  43.  
  44. INT letter_number           ' Used for displaying letters in ENTER
  45. INT color                   ' Used for color selection
  46. INT xpos                    ' Cursor position
  47. INT ypos                    ' Cursor position
  48.  
  49. FLOAT time_now              ' Current TIME
  50. FLOAT prev_ti               ' Previous TIME
  51.  
  52. BOOLEAN gmode               ' Graphics Mode of user
  53. ;──────────────────────────────────────────────────────────────────────────────
  54.  
  55. '
  56. '  Set Initial values for a couple of variables
  57. '
  58. letter_number = 1
  59. color = 1
  60.  
  61.    '
  62.    '  Determine path for pcb swap file
  63.    '
  64.    hold = READLINE(PCBDAT(),204)
  65.    hold = FILEINF(hold,6) + ":" + FILEINF(hold,7)
  66.  
  67.    '
  68.    '  Determine path/filename of tagged msg file and semaphore file
  69.    '
  70.    sema_path = hold + "msgtag.use"
  71.    tag_msg_file = hold + "mtg" + STRING(CURCONF()) + ".lst"
  72.    page_length_file = hold + "userpl.dat"
  73.  
  74.    IF (EXIST(sema_path)) THEN
  75.  
  76.      '
  77.      '  execute MORE.PPE here so that user can tag messages
  78.      '  when there is not a complete screen and the "normal" more
  79.      '  prompt is not used.
  80.      '
  81.      DISPTEXT 196, GRAPH+LANG
  82.  
  83.      '
  84.      '  Set page length back
  85.      '
  86.      GETUSER
  87.  
  88.      '
  89.      '  Need to read a file here to get users old page length setting
  90.      '
  91.      IF (EXIST(page_length_file)) THEN
  92.        FOPEN 7, page_length_file, O_RD, S_DN
  93.        FGET 7, hold
  94.        U_PAGELEN = TOINT(hold)
  95.        FCLOSE 7
  96.        PUTUSER
  97.        DELETE page_length_file
  98.      END IF
  99.      IF (FILEINF(tag_msg_file,4) = 0) DELETE tag_msg_file
  100.      DELETE sema_path
  101.    END IF
  102.  
  103. '
  104. '   See if the user support ANSI
  105. '
  106.    GOSUB SET_COLOR_MODE
  107.  
  108. '
  109. '   Display the prompt and wait for a CR from the user to exit PPE
  110. '   (We do this by watching the modem for input from user with MGETBYTE
  111. '    command and looping ENDLESSLY until CR or keyboard timeout occurs)
  112. '
  113.    IF (GRAFMODE()="G") THEN
  114.       '
  115.       '  Modify this next line for how your want
  116.       '  your WAIT prompt to appear
  117.       '
  118.       prompt = SPACE(17) + "@X03───@X0B─═══ Press @X02(@X03Enter@X02) @X0Bto Continue @X0B═══─@X03───@X07"
  119.       PRINT CHR(13)
  120.       NEWLINE
  121.       xpos = GETX()
  122.       ypos = GETY()
  123.       ANSIPOS xpos, ypos
  124.       PRINT prompt
  125.    ELSE
  126.      '
  127.      '  Modify this prompt to your liking for the non-ansi user
  128.      '
  129.      prompt = SPACE(17) + "────═══Press (Enter) to Continue═══────"
  130.      PRINT prompt
  131.    END IF
  132.  
  133.  
  134.    '
  135.    '  Loop endlessly until the user or sysop hits ENTER
  136.    '
  137.    WHILE (1) DO
  138.      hold = MGETBYTE()
  139.      IF (hold = 13 || hold = CHR(13)) THEN
  140.        GOSUB STUFF_IT
  141.      ELSE
  142.        hold = KINKEY()
  143.        IF (hold = 13 || hold = CHR(13)) GOSUB STUFF_IT
  144.      END IF
  145.      '
  146.      ' ────────────────────────────────────────────────────────────────┐
  147.      ' Remove the next statement if you do not want "ENTER" to have    │
  148.      ' the letters changing color while waiting for the user to respond│        │
  149.      ' ────────────────────────────────────────────────────────────────┘
  150.      '
  151.      IF (GRAFMODE() = "G") GOSUB DISPLAY_LETTER
  152.      '
  153.    END WHILE
  154.  
  155.    END
  156.  
  157. '
  158. '  Stuff a carriage return into keyboard
  159. '
  160. :STUFF_IT
  161.  
  162.     KBDSTUFF CHR(13)
  163.     END
  164.  
  165. '
  166. '  Sets the next color to be displayed
  167. '
  168. :SET_NEW_COLOR
  169.  
  170.     IF (color = 5) color = 1
  171.     SELECT CASE (color)
  172.       CASE 1
  173.           hold1 = red(gmode)
  174.       CASE 2
  175.           hold1 = green(gmode)
  176.       CASE 3
  177.           hold1 = cyan(gmode)
  178.       CASE 4
  179.           hold1 = purple(gmode)
  180.     END SELECT
  181.     INC color
  182.     RETURN
  183.  
  184. '
  185. '     This is the routine to display the letters one at a time
  186. '
  187. :DISPLAY_LETTER
  188.     IF (letter_number > 5) letter_number = 1
  189.     SELECT CASE (letter_number)
  190.       CASE 1
  191.         ANSIPOS xpos+32, ypos
  192.         GOSUB SET_NEW_COLOR
  193.         PRINT hold1 + "E"
  194.         DELAY 5
  195.       CASE 2
  196.         ANSIPOS xpos+33, ypos
  197.         GOSUB SET_NEW_COLOR
  198.         PRINT hold1 + "n"
  199.         DELAY 5
  200.       CASE 3
  201.         ANSIPOS xpos+34, ypos
  202.         GOSUB SET_NEW_COLOR
  203.         PRINT hold1 + "t"
  204.         DELAY 5
  205.       CASE 4
  206.         ANSIPOS xpos+35, ypos
  207.         GOSUB SET_NEW_COLOR
  208.         PRINT hold1 + "e"
  209.         DELAY 5
  210.       CASE 5
  211.         ANSIPOS xpos+36, ypos
  212.         GOSUB SET_NEW_COLOR
  213.         PRINT hold1 + "r"
  214.         GOSUB SET_NEW_COLOR
  215.         DELAY 5
  216.     END SELECT
  217.     INC letter_number
  218.     RETURN
  219.  
  220. '
  221. '  Set high intensity or low intensity for colors based on users preference
  222. '
  223. :SET_COLOR_MODE
  224. '
  225. '    Set the color variables either to nothing or to an ANSI
  226. '    color depending if the user supports it or not.  Support
  227. '    is determined by using the GRAFMODE() command.
  228. '
  229. '    **--> Subroutine Idea originally from DLPROMPT.PPE
  230. '
  231. '    N = No ANSI
  232. '    A = Ansi with no color
  233. '    G = Ansi with color
  234. '    R = RIP Graphics
  235. '
  236.    esc = CHR(27)
  237.    gmode = GRAFMODE()="A"
  238. ;
  239. ;  User supports ANSI
  240. ;
  241.    dcyan(0)  = esc + "[0;36m"
  242.    cyan(0) = esc + "[1;36m"
  243.    white(0) = esc + "[1;37m"
  244.    normal(0) = esc + "[0m"
  245.    yellow(0)  = esc + "[1;33m"
  246.    purple(0)  = esc + "[1;35m"
  247.    green(0)  = esc + "[1;32m"
  248.    red(0)  = esc + "[1;31m"
  249. ;
  250. ;  User does not support ANSI
  251. ;
  252.    yellow(1)  = ""
  253.    green(1)  = ""
  254.    white(1) = ""
  255.    dcyan(1) = ""
  256.    cyan(1) = ""
  257.    normal(1) = ""
  258.    red(1)  = ""
  259.    RETURN
  260.